#ifndef _SUITETYPE_H_
#define _SUITETYPE_H_
#include "SimpleNode.h"
#include "ast/stmtType.h"
class IVisitor;
class suiteType;
typedef QSharedPointer<suiteType> suiteTypePtr;

class suiteType: public SimpleNode
{
public:
    explicit suiteType(const StmtTypeList& body, int nodeId=-1);
    virtual ~suiteType();
    
    
    StmtTypeList body();
    void setBody(const StmtTypeList& body);
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
    StmtTypeList _body;
};



typedef QListIterator<suiteTypePtr> SuiteTypePtrListIterator;

class SuiteTypeList: public QList<suiteTypePtr>
{
public:
    inline SuiteTypeList() { }
    inline explicit SuiteTypeList(suiteTypePtr i) { append(i); }
    inline SuiteTypeList(const SuiteTypeList &l) : QList<suiteTypePtr>(l) { }
    inline SuiteTypeList(const QList<suiteTypePtr> &l) : QList<suiteTypePtr>(l) { }

    inline SuiteTypeList operator+(const SuiteTypeList &other) const
    { SuiteTypeList n = *this; n += other; return n; }
    inline SuiteTypeList &operator<<(suiteTypePtr it)
    { append(it); return *this; }
    inline SuiteTypeList &operator<<(const SuiteTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("SuiteTypeList(");
        foreach(suiteTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(suiteTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif